package com.ruoyi.sample.service.impl;

import java.util.List;

import com.ruoyi.experiment.domain.Project;
import com.ruoyi.experiment.domain.SampleRecovery;
import com.ruoyi.sample.mapper.SampleRecoveryMapper;
import com.ruoyi.sample.model.RItem;
import com.ruoyi.sample.service.ISampleRecoveryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 样品回收Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-11
 */
@Service
public class SampleRecoveryServiceImpl implements ISampleRecoveryService
{
    @Autowired
    private SampleRecoveryMapper sampleRecoveryMapper;

    /**
     * 查询样品回收
     *
     * @param recoveryId 样品回收主键
     * @return 样品回收
     */
    @Override
    public SampleRecovery selectSampleRecoveryByRecoveryId(Long recoveryId)
    {
        return sampleRecoveryMapper.selectSampleRecoveryByRecoveryId(recoveryId);
    }

    /**
     * 查询样品回收列表
     *
     * @param sampleRecovery 样品回收
     * @return 样品回收
     */
    @Override
    public List<SampleRecovery> selectSampleRecoveryList(SampleRecovery sampleRecovery)
    {
        return sampleRecoveryMapper.selectSampleRecoveryList(sampleRecovery);
    }

    /**
     * 新增样品回收
     *
     * @param sampleRecovery 样品回收
     * @return 结果
     */
    @Override
    public int insertSampleRecovery(SampleRecovery sampleRecovery)
    {
        return sampleRecoveryMapper.insertSampleRecovery(sampleRecovery);
    }

    /**
     * 修改样品回收
     *
     * @param sampleRecovery 样品回收
     * @return 结果
     */
    @Override
    public int updateSampleRecovery(SampleRecovery sampleRecovery)
    {
        return sampleRecoveryMapper.updateSampleRecovery(sampleRecovery);
    }

    /**
     * 批量删除样品回收
     *
     * @param recoveryIds 需要删除的样品回收主键
     * @return 结果
     */
    @Override
    public int deleteSampleRecoveryByRecoveryIds(Long[] recoveryIds)
    {
        return sampleRecoveryMapper.deleteSampleRecoveryByRecoveryIds(recoveryIds);
    }

    /**
     * 删除样品回收信息
     *
     * @param recoveryId 样品回收主键
     * @return 结果
     */
    @Override
    public int deleteSampleRecoveryByRecoveryId(Long recoveryId)
    {
        return sampleRecoveryMapper.deleteSampleRecoveryByRecoveryId(recoveryId);
    }

    @Override
    public List<RItem> selectAllItem(Project pro) {
        return sampleRecoveryMapper.selectAllItem(pro);
    }
}
